<template>
	<view>
		<!-- 返回首页 -->
		<uni-bankhome />
		<u-navbar :custom-back="back" :title="title"></u-navbar>
		<view v-if="policy.orderList.length === 0">
			<u-empty text="暂无记录" mode="list" >
			</u-empty>
		</view>
		<view v-else class="money-wrapper">
			<div v-for="item in policy.orderList" class="box list" @click="bank(item)">
				<div class="list-left">{{ item.title }}</div>
				<div class="list-right">
					<u-icon name="arrow-right"></u-icon>
				</div>
			</div>
			<uni-load-more :status="policy.loadStatus"></uni-load-more>
		</view>
	</view>
</template>

<script>
	import {
		articlelist
	} from "@/api/withdrawal.js";
	import storage from "@/utils/storage.js"
	import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue";
	export default {
		components: {
			uniLoadMore
		},
		data() {
			return {
				flowpriceSum: '', // 销售钱包余额
				surplusSum: '', // 对应人民币
				fee: '', // 对应折扣
				isshow: 0,
				lightColor: this.$lightColor,
				title: '加盟政策',
				form: {
					money: '',
					owner: 'SALE'
				},
				userInfo: {},
				policy: {
					loadStatus: "more",
					orderList: [],
					pageNumber: 1,
				},
				params: {
					pageNumber: 1,
					pageSize: 10,
					type: 'FRANCHISE_POLICY'
				},
				
			}
		},
		onReachBottom() {
			this.getlist()
		},
		onShow() {
			this.userInfo = storage.getUserInfo()
		},
		onLoad() {
			this.getlist()
		},
		
		methods: {
			// 确认提现
			getlist () {
				this.params.pageNumber = this.policy.pageNumber;
				articlelist(this.params).then((res) => {
					if (res.data && res.data.code == 200) {
						uni.stopPullDownRefresh();
						if (!res.data.success) {
							this.policy.loadStatus = "noMore";
							return false;
						}
						let orderList = res.data.result.records;
						if (orderList.length == 0) {
							this.policy.loadStatus = "noMore";
						} else if (orderList.length < 10) {
							this.policy.loadStatus = "noMore";
						}
						if (orderList.length > 0) {
							this.policy.orderList =
								this.policy.orderList.concat(orderList);
							this.policy.pageNumber += 1;
						}
					}
				});
			},
			// 详情
			bank (item) {
				uni.navigateTo({
					url: "/pages/mine/set/pdetails?title=" +
						item.title +
						"&id=" +
						item.id
				})
			},
			// 返回
			back () {
				uni.switchTab({
					url: "/pages/tabbar/user/my",
				});
			},
		}
	}
</script>

<style lang="scss">
	.money-wrapper {
		margin-top: 24upx;
		// display: flex;
	
		.box {
			display: flex;
			margin: 20rpx 0;
			border-radius: 20rpx;
	
			padding: 40rpx;
	
			.money {
				text-align: center;
				color: #333;
				font-size: 50rpx;
				margin: 20rpx 0 40rpx 0;
				letter-spacing: 2rpx;
			}
	
			.deposit {
				margin-top: 50rpx;
				text-align: center;
				color: #999;
				font-size: 28rpx;
	
				letter-spacing: 2rpx;
			}
		}
		.list {
			// margin-top: 40upx;
			padding: 36upx;
			display: flex;
			justify-content: center;
			align-items: center;
			background-color: #fff;
		
			.list-left {
				flex: 8;
			}
		
			.list-right {
				flex: 2;
				text-align: right;
			}
		}
	}
	.record {
		display: flex;
		justify-content: flex-end;
		.to-store-btn {
			padding: 15upx 30upx;
			margin-top: 30upx;
			margin-right: 30upx;
			color: #fff;
			border-radius: 214px;
			background-image: linear-gradient(135deg, #f2140c, #f2270c 70%, #f24d0c);
			font-size: 22rpx;
		}
	}
	.money {
		padding: 30upx 30upx;
		.moneysss {
			border-bottom: 2upx solid #999;
		}
	}
	.moneytype{
		position: relative;
		.u-radio {
			clear: both !important;
			padding: 15upx 30upx;
		}
		.whole {
			span {
				position: absolute;
				right: 20px;
				top: 10px;
				color: #c34463
			}
		}
		.whole2 {
			span {
				position: absolute;
				right: 20px;
				top: 50px;
				color: #c34463
			}
		}
	}
	.operation-btns {
		padding: 24upx 0;
		display: flex;
		justify-content: center;
		align-items: center;
		background: #fff;
		margin-top: 30upx;
	
		.operation-btn {
			background: #ee6d41;
			color: #fff;
			height: 90rpx;
			width: 240rpx;
			margin: 0 20rpx;
			border-radius: 10rpx;
			text-align: center;
			line-height: 90rpx;
			font-size: 32rpx;
		}
	}
	.cash {
		margin-top: 15upx;
	}
	
</style>
